<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'family-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="hint">Поля с <span class="required">*</span> обязательны для заполнения.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'brand_id'); ?>
		<?php echo $form->dropDownList($model,'brand_id', CHtml::listData( Brand::model()->findAll(array('order'=>'title')), 'id', 'title')); ?>
		<?php echo $form->error($model,'brand_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'alias'); ?>
		<?php echo $form->textField($model,'alias',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'alias'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'archive'); ?>
		<?php echo $form->dropDownList($model,'archive', Lookup::items('ArchiveStatus')); ?>
		<?php echo $form->error($model,'archive'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'manufacture_start'); ?>
		<?php
		$this->widget('ext.timepicker.TimePicker', array(
			'id'=>'manufacture_start',
			'model'=>$model,
			'name'=>'manufacture_start',
			'options'=>array(
				'duration'=>'',
				'showTime'=>false,
				'dateFormat'=>'yy-mm-dd',
				'firstDay' => 1,
				'showOn'=>'button',
				'changeMonth'=>true,
				'changeYear'=>true,
			),
		));
		?>
		<?php echo $form->error($model,'manufacture_start'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'manufacture_end'); ?>
		<?php
		$this->widget('ext.timepicker.TimePicker', array(
			'id'=>'manufacture_end',
			'model'=>$model,
			'name'=>'manufacture_end',
			'options'=>array(
				'duration'=>'',
				'showTime'=>true,
				'time24h'=>true,
				'dateFormat'=>'yy-mm-dd',
				'firstDay' => 1,
				'stepMinutes'=>5,
				'showOn'=>'button',
				'changeMonth'=>true,
				'changeYear'=>true,
			),
		));
		?>
		<?php echo $form->error($model,'manufacture_end'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
				<?php
		switch(AController::_user()->profile->editor){
			case 2:
				echo 'CKEditor editor in progress...';
			break;
			case 1:
				echo 'TinyMCE editor in progress...';
			break;
			default:
				$this->widget('ext.markitup.EMarkitUp', array(
					'id'=>'description',
					'model'=>$model,
					'name'=>'description',
					'options'=>array(
						'set'=>'markdown',
					),
				));
			break;
		}
		?>
		<?php echo $form->error($model,'description'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Создать' : 'Сохранить'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->